package cn.zhentao.service.impl;

import cn.zhentao.dao.PhoneADao;
import cn.zhentao.pojo.*;
import cn.zhentao.service.PhonAService;
import cn.zhentao.vo.CartVo;
import cn.zhentao.vo.OrderVo;
import cn.zhentao.vo.PageInfoA;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PhoneAServiceImpl implements PhonAService {
    @Autowired
    private PhoneADao phoneADao;
    //模糊查询根据类型  Pura
    @Override
    public List<Phone> findByPhoneTypeLikePura() {
        return phoneADao.findByPhoneTypeLikePura();
    }
    //模糊查询根据类型  Pocket
    @Override
    public List<Phone> findByPhoneTypeLikePocket() {
        return phoneADao.findByPhoneTypeLikePocket();
    }
    //模糊查询根据类型  Mate
    @Override
    public List<Phone> findByPhoneTypeLikeMate() {
        return phoneADao.findByPhoneTypeLikeMate();
    }
    //模糊查询根据类型  nova
    @Override
    public List<Phone> findByPhoneTypeLikeNova() {
        return phoneADao.findByPhoneTypeLikeNova();
    }

    @Override
    public Img findBySrcLikePura(int id) {
        return phoneADao.findBySrcLikePura(id);
    }

    @Override
    public Img findBySrcLikePocket(int id) {
        return phoneADao.findBySrcLikePocket(id);
    }

    @Override
    public Img findBySrcLikeMate(int id) {
        return phoneADao.findBySrcLikeMate(id);
    }

    @Override
    public Img findBySrcLikenova(int id) {
        return phoneADao.findBySrcLikenova(id);
    }

    @Override
    public List<Menu> findAllMenu() {
        return phoneADao.findAllMenu();
    }

    @Override
    public List<Color> findAllColorByPhoneId(int id) {
        return phoneADao.findAllColorByPhoneId(id);
    }

    @Override
    public List<Version> findAllVersionByPhoneId(int id) {
        return phoneADao.findAllVersionByPhoneId(id);
    }

    @Override
    public Price findAllPriceByPhoneIdAndVersionId(Integer phonef_id, Integer version_id) {
        return phoneADao.findAllPriceByPhoneIdAndVersionId(phonef_id,version_id);
    }

    @Override
    public int insertCart(Cart cart) {
        return phoneADao.insertCart(cart);
    }

    @Override
    public List<CartVo> findAllCart(int userId) {
        return phoneADao.findAllCartByUserId(userId);
    }
    @Override
    public int updateInven(int num, int id) {
        return phoneADao.updateInven(num,id);
    }
    @Override
    public List<Phone> findByPhoneAll(PageInfoA pageInfoA) {
        return phoneADao.findByPhoneAll(pageInfoA);
    }

    @Override
    public Img findByImgAllByPhoneId(int id) {
        return phoneADao.findByImgAllByPhoneId(id);
    }

    @Override
    public List<Price> findPriceAllByPhoneId(int id,PageInfoA pageInfoA) {
        return phoneADao.findPriceAllByPhoneId(id,pageInfoA);
    }

    @Override
    public int deletePhone(int id) {
        return phoneADao.deletePhone(id);
    }

    @Override
    public List<Version> findAllVerison() {
        return phoneADao.findAllVerison();
    }

    @Override
    public List<Color> findAllColor() {
        return phoneADao.findAllColor();
    }

    @Override
    public int insertPhone(Phone phone) {
        return phoneADao.insertPhone(phone);
    }

    @Override
    public int insertPhoneColor(int phoneId, int colorId) {
        return phoneADao.insertPhoneColor(phoneId,colorId);
    }

    @Override
    public int insertPrice(Price price) {
        return phoneADao.insertPrice(price);
    }

    @Override
    public int insertPhonePriceVersion(int phonefId, int versionId, int priceId) {
        return phoneADao.insertPhonePriceVersion(phonefId,versionId,priceId);
    }

    @Override
    public int insertImg(Img img) {
        return phoneADao.insertImg(img);
    }

    @Override
    public Phone findByphoneTypePhone(String phoneType) {
        return phoneADao.findByphoneTypePhone(phoneType);
    }

    @Override
    public int updatephoneInven(Integer phoneInven,Integer id) {
        //修改库存 管理端
        return phoneADao.updatephoneInven(phoneInven,id);
    }

    @Override
    public int deletePhoneColor(Integer id) {
        return phoneADao.deletePhoneColor(id);
    }

    @Override
    public int updatePrice(Double prices, Integer id1) {
        return phoneADao.updatePrice(prices,id1);
    }
    @Override
    public List<MenuAdmin> findAllMenuAdmin() {
        return phoneADao.findAllMenuAdmin();
    }
    @Override
    public int updateAdmin(Address address) {
        return phoneADao.updateAdmin(address);
    }
    @Override
    public int deleteCart(int id) {
        return phoneADao.deleteCart(id);
    }
    @Override
    public int insertOrder(Order order) {
        return phoneADao.insertOrder(order);
    }
    @Override
    public List<OrderVo> findAllOrder(int userId) {
        return phoneADao.findAllOrder(userId);
    }

    @Override
    public int updateState(int id) {
        return phoneADao.updateState(id);
    }

    @Override
    public int fahuoUpdate(int id) {
        return phoneADao.fahuoUpdate(id);
    }

    @Override
    public int updatetuihuo(int id) {
        return phoneADao.updatetuihuo(id);
    }

    @Override
    public int UpdateTuiHuoAdmin(int id) {
        return phoneADao.UpdateTuiHuoAdmin(id);
    }

    @Override
    public int UpdateRefuseReturn(int id) {
        return phoneADao.UpdateRefuseReturn(id);
    }

    @Override
    public int updateJuShou(int id) {
        return phoneADao.updateJuShou(id);
    }

    @Override
    public List<OrderVo> findAllOrderAdmin() {
        return phoneADao.findAllOrderAdmin();
    }
}
